package api

import (
<<<<<<< HEAD
	"gf_api/library/response"

	"github.com/gogf/gf/frame/g"
=======
	"github.com/gogf/gf/errors/gerror"
>>>>>>> 69ad23efccf685fb3fd8ec8a2953f815bb9beec9
	"github.com/gogf/gf/net/ghttp"
)

var Hello = helloAPI{}

type helloAPI struct{}

type RegisterReq struct {
	Name  string
	Pass  string `p:"password1"`
	Pass2 string `p:"password2"`
}

// SayHello  is a demonstration route handler for output "Hello World!".
func (*helloAPI) SayHello(r *ghttp.Request) {
	// var req *RegisterReq
	// r.Response.Write(r.Get("name"))
	// data
	lsData := r.GetParamVar("name").String()
	println(lsData)
	println("adsfasdf")
	// println(r.Get("name").)
	data := g.Map{"name": "直接asdasdasdasd昂"}
	// getData := r.Get()
	response.JsonExit(r, 200, "", data)

<<<<<<< HEAD
=======
// Index is a demonstration route handler for output "Hello World!".
func (*helloApi) Index(r *ghttp.Request) {
	err := gerror.NewCode(203, "这是一个错误")
	panic(err)

>>>>>>> 69ad23efccf685fb3fd8ec8a2953f815bb9beec9
}
